// const qing = {
//     name:'青凌',
//     age:18,
//     career:'coder'
// }

function Coder(name, age){
    this.name = name
    this.age = age
    this.career = 'coder'
    this.work = ['写代码','摸鱼']
}
function Product(name,age){
    this.name=name
    this.age=age
    this.career='product'
    this.work=['做需求','订会议室','催更']
}

// 开放和封闭原则，比如name,age,career是开放的，可以自定义的，this.name,this.age就是封闭的
function User(name,age,career){
    this.name = name
    this.age = age
    this.career = career
}
// 用构造函数批量化实例化
function Factory(name,age,career){
    switch (career){
        case 'coder':
            return new Coder(name,age);
        case 'product':
            return new Product(name,age);
    }
}
// 如果有多个工种，此时要创建多个工种的类

